/**
 *
 */
import Util;
import OpenApi;
import OpenApiUtil;
import EndpointUtil;

extends OpenApi;


init(config: OpenApi.Config){
  super(config);
  @endpointRule = '';
  
  checkConfig(config);
  @endpoint = getEndpoint('live-interaction', @regionId, @endpointRule, @network, @suffix, @endpointMap, @endpoint);
}

function getEndpoint(productId: string, regionId: string, endpointRule: string, network: string, suffix: string, endpointMap: map[string]string, endpoint: string) throws: string{
  if (!Util.empty(endpoint)) {
    return endpoint;
  }
  
  if (!Util.isUnset(endpointMap) && !Util.empty(endpointMap[regionId])) {
    return endpointMap[regionId];
  }
  return EndpointUtil.getEndpointRules(productId, regionId, endpointRule, network, suffix);
}

model ResultUserMuteSettingsValue = {
  mute?: boolean(name='Mute'),
  expireTime?: long(name='ExpireTime'),
}

model ResultImportMessageResultValue = {
  result?: long(name='result', example='0'),
  msgId?: string(name='msgId', example='111111$NT'),
}

model RequestParamsUserConversationsValue = {
  top?: boolean(name='Top', example='true'),
  redPoint?: long(name='RedPoint', example='0'),
  mute?: boolean(name='Mute', example='false'),
  visible?: boolean(name='Visible', example='1'),
  createTime?: long(name='CreateTime'),
  modifyTime?: long(name='ModifyTime'),
  userExtensions?: map[string]string(name='UserExtensions'),
}

model RequestParamsOptionsSingleChatCreateRequestUserConversationValue = {
  userExtensions?: map[string]string(name='UserExtensions'),
}

model AddGroupMembersRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    appCid?: string(name='AppCid', example='$2$111000****'),
    initMembers?: [ 
      {
        appUid?: string(name='AppUid', example='888666'),
        extensions?: map[string]string(name='Extensions'),
        joinTime?: long(name='JoinTime', example='1608739200000'),
        nick?: string(name='Nick', example='test'),
        role?: int32(name='Role', example='3'),
      }
    ](name='InitMembers'),
    operatorAppUid?: string(name='OperatorAppUid', example='112233'),
  }(name='RequestParams'),
}

model AddGroupMembersShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model AddGroupMembersResponseBody = {
  code?: string(name='Code', example='Group.xxx'),
  message?: string(name='Message', example='Parameter Error'),
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378F720'),
}

model AddGroupMembersResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AddGroupMembersResponseBody(name='body'),
}

async function addGroupMembersWithOptions(tmpReq: AddGroupMembersRequest, runtime: Util.RuntimeOptions): AddGroupMembersResponse {
  Util.validateModel(tmpReq);
  var request = new AddGroupMembersShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'AddGroupMembers',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addGroupMembers(request: AddGroupMembersRequest): AddGroupMembersResponse {
  var runtime = new Util.RuntimeOptions{};
  return addGroupMembersWithOptions(request, runtime);
}

model AddGroupSilenceBlacklistRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    appCid?: string(name='AppCid', example='$2$12345678'),
    members?: [ string ](name='Members'),
    operatorAppUid?: string(name='OperatorAppUid', example='123'),
    silenceDuration?: long(name='SilenceDuration', example='600'),
  }(name='RequestParams', example='apitest'),
}

model AddGroupSilenceBlacklistShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams', example='apitest'),
}

model AddGroupSilenceBlacklistResponseBody = {
  code?: string(name='Code', example='General.SystemError'),
  message?: string(name='Message', example='System Error'),
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378F720'),
}

model AddGroupSilenceBlacklistResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AddGroupSilenceBlacklistResponseBody(name='body'),
}

async function addGroupSilenceBlacklistWithOptions(tmpReq: AddGroupSilenceBlacklistRequest, runtime: Util.RuntimeOptions): AddGroupSilenceBlacklistResponse {
  Util.validateModel(tmpReq);
  var request = new AddGroupSilenceBlacklistShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'AddGroupSilenceBlacklist',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addGroupSilenceBlacklist(request: AddGroupSilenceBlacklistRequest): AddGroupSilenceBlacklistResponse {
  var runtime = new Util.RuntimeOptions{};
  return addGroupSilenceBlacklistWithOptions(request, runtime);
}

model AddGroupSilenceWhitelistRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    appCid?: string(name='AppCid', example='$2$111000'),
    members?: [ string ](name='Members'),
    operatorAppUid?: string(name='OperatorAppUid', example='123'),
  }(name='RequestParams', example='apitest'),
}

model AddGroupSilenceWhitelistShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams', example='apitest'),
}

model AddGroupSilenceWhitelistResponseBody = {
  code?: string(name='Code', example='General.SystemError'),
  message?: string(name='Message', example='System Error'),
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378F720'),
}

model AddGroupSilenceWhitelistResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: AddGroupSilenceWhitelistResponseBody(name='body'),
}

async function addGroupSilenceWhitelistWithOptions(tmpReq: AddGroupSilenceWhitelistRequest, runtime: Util.RuntimeOptions): AddGroupSilenceWhitelistResponse {
  Util.validateModel(tmpReq);
  var request = new AddGroupSilenceWhitelistShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'AddGroupSilenceWhitelist',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function addGroupSilenceWhitelist(request: AddGroupSilenceWhitelistRequest): AddGroupSilenceWhitelistResponse {
  var runtime = new Util.RuntimeOptions{};
  return addGroupSilenceWhitelistWithOptions(request, runtime);
}

model BindInterconnectionCidRequest {
  appId?: string(name='AppId', description='AppId', example='apitest'),
  requestParams?: {
    aimAppCid?: string(name='AimAppCid', example='$2$112345'),
    dingTalkCid?: string(name='DingTalkCid', example='111489'),
  }(name='RequestParams'),
}

model BindInterconnectionCidShrinkRequest {
  appId?: string(name='AppId', description='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model BindInterconnectionCidResponseBody = {
  code?: string(name='Code', example='User.xxx'),
  message?: string(name='Message', example='System Error'),
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378F720'),
}

model BindInterconnectionCidResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: BindInterconnectionCidResponseBody(name='body'),
}

/**
  * @deprecated
  *
  * @param tmpReq BindInterconnectionCidRequest
  * @param runtime runtime options for this request RuntimeOptions
  * @return BindInterconnectionCidResponse
 */
// Deprecated
async function bindInterconnectionCidWithOptions(tmpReq: BindInterconnectionCidRequest, runtime: Util.RuntimeOptions): BindInterconnectionCidResponse {
  Util.validateModel(tmpReq);
  var request = new BindInterconnectionCidShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'BindInterconnectionCid',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
  * @deprecated
  *
  * @param request BindInterconnectionCidRequest
  * @return BindInterconnectionCidResponse
 */
// Deprecated
async function bindInterconnectionCid(request: BindInterconnectionCidRequest): BindInterconnectionCidResponse {
  var runtime = new Util.RuntimeOptions{};
  return bindInterconnectionCidWithOptions(request, runtime);
}

model BindInterconnectionUidRequest {
  appId?: string(name='AppId', description='AppId', example='apitest'),
  requestParams?: {
    appUid?: string(name='AppUid', example='123'),
    dingTalkUid?: string(name='DingTalkUid', example='abc#corpId'),
  }(name='RequestParams'),
}

model BindInterconnectionUidShrinkRequest {
  appId?: string(name='AppId', description='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model BindInterconnectionUidResponseBody = {
  code?: string(name='Code', example='system'),
  message?: string(name='Message', example='error'),
  requestId?: string(name='RequestId', example='1234'),
}

model BindInterconnectionUidResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: BindInterconnectionUidResponseBody(name='body'),
}

/**
  * @deprecated
  *
  * @param tmpReq BindInterconnectionUidRequest
  * @param runtime runtime options for this request RuntimeOptions
  * @return BindInterconnectionUidResponse
 */
// Deprecated
async function bindInterconnectionUidWithOptions(tmpReq: BindInterconnectionUidRequest, runtime: Util.RuntimeOptions): BindInterconnectionUidResponse {
  Util.validateModel(tmpReq);
  var request = new BindInterconnectionUidShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'BindInterconnectionUid',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
  * @deprecated
  *
  * @param request BindInterconnectionUidRequest
  * @return BindInterconnectionUidResponse
 */
// Deprecated
async function bindInterconnectionUid(request: BindInterconnectionUidRequest): BindInterconnectionUidResponse {
  var runtime = new Util.RuntimeOptions{};
  return bindInterconnectionUidWithOptions(request, runtime);
}

model CancelSilenceAllGroupMembersRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    appCid?: string(name='AppCid', example='$2$10010'),
    operatorAppUid?: string(name='OperatorAppUid', example='123123'),
  }(name='RequestParams'),
}

model CancelSilenceAllGroupMembersShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model CancelSilenceAllGroupMembersResponseBody = {
  code?: string(name='Code', example='General.SystemError'),
  message?: string(name='Message', example='System Error'),
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378F720'),
}

model CancelSilenceAllGroupMembersResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CancelSilenceAllGroupMembersResponseBody(name='body'),
}

async function cancelSilenceAllGroupMembersWithOptions(tmpReq: CancelSilenceAllGroupMembersRequest, runtime: Util.RuntimeOptions): CancelSilenceAllGroupMembersResponse {
  Util.validateModel(tmpReq);
  var request = new CancelSilenceAllGroupMembersShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CancelSilenceAllGroupMembers',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function cancelSilenceAllGroupMembers(request: CancelSilenceAllGroupMembersRequest): CancelSilenceAllGroupMembersResponse {
  var runtime = new Util.RuntimeOptions{};
  return cancelSilenceAllGroupMembersWithOptions(request, runtime);
}

model CreateGroupRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    creatorAppUid?: string(name='CreatorAppUid', example='9100088885****'),
    entranceId?: string(name='EntranceId'),
    extensions?: map[string]string(name='Extensions'),
    iconMediaId?: string(name='IconMediaId', example='abc123'),
    initMembers?: [ 
      {
        appUid?: string(name='AppUid', example='8866'),
        extensions?: map[string]string(name='Extensions'),
        joinTime?: long(name='JoinTime', example='1608739200000'),
        nick?: string(name='Nick', example='Alice'),
        role?: int32(name='Role', example='3'),
      }
    ](name='InitMembers'),
    title?: string(name='Title', example='good'),
    uuid?: string(name='Uuid', example='12345678998765'),
  }(name='RequestParams'),
}

model CreateGroupShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model CreateGroupResponseBody = {
  code?: string(name='Code', example='Group.xxx'),
  message?: string(name='Message', example='Error Message'),
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378F720'),
  result?: {
    appCid?: string(name='AppCid', example='$2$111000'),
  }(name='Result'),
}

model CreateGroupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateGroupResponseBody(name='body'),
}

async function createGroupWithOptions(tmpReq: CreateGroupRequest, runtime: Util.RuntimeOptions): CreateGroupResponse {
  Util.validateModel(tmpReq);
  var request = new CreateGroupShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateGroup',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function createGroup(request: CreateGroupRequest): CreateGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return createGroupWithOptions(request, runtime);
}

model CreateRoomRequest {
  request?: {
    domain?: string(name='domain', example='testAppKey'),
    ownerId?: string(name='ownerId', example='1234'),
    ownerNick?: string(name='ownerNick', example='testNick'),
    title?: string(name='title', example='testTitle'),
  }(name='Request', example='CreateRoom'),
}

model CreateRoomResponseBody = {
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378****'),
  responseSuccess?: boolean(name='ResponseSuccess', example='true'),
  result?: {
    roomId?: string(name='roomId', example='testRoomId'),
  }(name='Result'),
  errorCode?: string(name='errorCode', example='1001'),
  errorMsg?: string(name='errorMsg', example='参数错误'),
}

model CreateRoomResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: CreateRoomResponseBody(name='body'),
}

/**
  * @deprecated
  *
  * @param request CreateRoomRequest
  * @param runtime runtime options for this request RuntimeOptions
  * @return CreateRoomResponse
 */
// Deprecated
async function createRoomWithOptions(request: CreateRoomRequest, runtime: Util.RuntimeOptions): CreateRoomResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  var bodyFlat : map[string]any = {};
  if (!Util.isUnset(request.request)) {
    bodyFlat['Request'] = request.request;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'CreateRoom',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
  * @deprecated
  *
  * @param request CreateRoomRequest
  * @return CreateRoomResponse
 */
// Deprecated
async function createRoom(request: CreateRoomRequest): CreateRoomResponse {
  var runtime = new Util.RuntimeOptions{};
  return createRoomWithOptions(request, runtime);
}

model DeleteAppRequest {
  appId?: string(name='AppId', example='aaa111'),
}

model DeleteAppResponseBody = {
  code?: string(name='Code', example='50001'),
  message?: string(name='Message', example='param error'),
  requestId?: string(name='RequestId', description='Id of the request', example='wefsdfttdsfsfwaf34456456sse'),
  success?: boolean(name='Success', example='false'),
}

model DeleteAppResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DeleteAppResponseBody(name='body'),
}

async function deleteAppWithOptions(request: DeleteAppRequest, runtime: Util.RuntimeOptions): DeleteAppResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DeleteApp',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function deleteApp(request: DeleteAppRequest): DeleteAppResponse {
  var runtime = new Util.RuntimeOptions{};
  return deleteAppWithOptions(request, runtime);
}

model DestroyRoomRequest {
  request?: {
    domain?: string(name='domain', example='testAppKey'),
    openId?: string(name='openId', example='testOpenId'),
    roomId?: string(name='roomId', example='testRoomId'),
  }(name='Request', example='DestroyRoom'),
}

model DestroyRoomResponseBody = {
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378****'),
  responseSuccess?: boolean(name='ResponseSuccess', example='true'),
  errorCode?: string(name='errorCode', example='1001'),
  errorMsg?: string(name='errorMsg', example='参数错误'),
  result?: boolean(name='result', example='true'),
}

model DestroyRoomResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DestroyRoomResponseBody(name='body'),
}

async function destroyRoomWithOptions(request: DestroyRoomRequest, runtime: Util.RuntimeOptions): DestroyRoomResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  var bodyFlat : map[string]any = {};
  if (!Util.isUnset(request.request)) {
    bodyFlat['Request'] = request.request;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DestroyRoom',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function destroyRoom(request: DestroyRoomRequest): DestroyRoomResponse {
  var runtime = new Util.RuntimeOptions{};
  return destroyRoomWithOptions(request, runtime);
}

model DismissGroupRequest {
  appId?: string(name='AppId'),
  requestParams?: {
    appCid?: string(name='AppCid', example='111000'),
    operatorAppUid?: string(name='OperatorAppUid'),
  }(name='RequestParams'),
}

model DismissGroupShrinkRequest {
  appId?: string(name='AppId'),
  requestParamsShrink?: string(name='RequestParams'),
}

model DismissGroupResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model DismissGroupResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: DismissGroupResponseBody(name='body'),
}

/**
  * @deprecated
  *
  * @param tmpReq DismissGroupRequest
  * @param runtime runtime options for this request RuntimeOptions
  * @return DismissGroupResponse
 */
// Deprecated
async function dismissGroupWithOptions(tmpReq: DismissGroupRequest, runtime: Util.RuntimeOptions): DismissGroupResponse {
  Util.validateModel(tmpReq);
  var request = new DismissGroupShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'DismissGroup',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
  * @deprecated
  *
  * @param request DismissGroupRequest
  * @return DismissGroupResponse
 */
// Deprecated
async function dismissGroup(request: DismissGroupRequest): DismissGroupResponse {
  var runtime = new Util.RuntimeOptions{};
  return dismissGroupWithOptions(request, runtime);
}

model GetCommonConfigRequest {
  appId?: string(name='AppId', example='aaa111'),
}

model GetCommonConfigResponseBody = {
  code?: string(name='Code', example='50001'),
  message?: string(name='Message', example='param error'),
  requestId?: string(name='RequestId', description='Id of the request', example='12345678'),
  result?: {
    commonConfig?: {
      appConfigs?: [ 
        {
          appKey?: string(name='AppKey', description='appKey', example='sdfwfsefewadzsdfasd'),
          platform?: string(name='Platform', example='iOS'),
        }
      ](name='AppConfigs'),
      loginConfig?: {
        loginType?: int32(name='LoginType', example='1'),
      }(name='LoginConfig'),
    }(name='CommonConfig'),
  }(name='Result'),
  success?: boolean(name='Success', example='true'),
}

model GetCommonConfigResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetCommonConfigResponseBody(name='body'),
}

async function getCommonConfigWithOptions(request: GetCommonConfigRequest, runtime: Util.RuntimeOptions): GetCommonConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetCommonConfig',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getCommonConfig(request: GetCommonConfigRequest): GetCommonConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return getCommonConfigWithOptions(request, runtime);
}

model GetGroupByIdRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    appCid?: string(name='AppCid', example='$2$11222333'),
  }(name='RequestParams'),
}

model GetGroupByIdShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model GetGroupByIdResponseBody = {
  code?: string(name='Code', example='General.SystemError'),
  message?: string(name='Message', example='System Error'),
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378F720'),
  result?: {
    appCid?: string(name='AppCid', example='$2$111000'),
    ceateTime?: long(name='CeateTime', example='1599999999'),
    extensions?: map[string]string(name='Extensions'),
    iconMediaId?: string(name='IconMediaId', example='@$111444'),
    memberCount?: int32(name='MemberCount', example='7'),
    memberLimit?: int32(name='MemberLimit', example='100'),
    ownerAppUid?: string(name='OwnerAppUid', example='123'),
    title?: string(name='Title'),
  }(name='Result'),
}

model GetGroupByIdResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetGroupByIdResponseBody(name='body'),
}

async function getGroupByIdWithOptions(tmpReq: GetGroupByIdRequest, runtime: Util.RuntimeOptions): GetGroupByIdResponse {
  Util.validateModel(tmpReq);
  var request = new GetGroupByIdShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetGroupById',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getGroupById(request: GetGroupByIdRequest): GetGroupByIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return getGroupByIdWithOptions(request, runtime);
}

model GetGroupMemberByIdsRequest {
  appId?: string(name='AppId'),
  requestParams?: {
    appCid?: string(name='AppCid', example='111000'),
    appUids?: [ string ](name='AppUids'),
  }(name='RequestParams'),
}

model GetGroupMemberByIdsShrinkRequest {
  appId?: string(name='AppId'),
  requestParamsShrink?: string(name='RequestParams'),
}

model GetGroupMemberByIdsResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  result?: {
    members?: [ 
      {
        appUid?: string(name='AppUid'),
        extensions?: map[string]string(name='Extensions'),
        joinTime?: long(name='JoinTime'),
        nick?: string(name='Nick'),
        role?: int32(name='Role'),
      }
    ](name='Members'),
  }(name='Result'),
}

model GetGroupMemberByIdsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetGroupMemberByIdsResponseBody(name='body'),
}

/**
  * @deprecated
  *
  * @param tmpReq GetGroupMemberByIdsRequest
  * @param runtime runtime options for this request RuntimeOptions
  * @return GetGroupMemberByIdsResponse
 */
// Deprecated
async function getGroupMemberByIdsWithOptions(tmpReq: GetGroupMemberByIdsRequest, runtime: Util.RuntimeOptions): GetGroupMemberByIdsResponse {
  Util.validateModel(tmpReq);
  var request = new GetGroupMemberByIdsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetGroupMemberByIds',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
  * @deprecated
  *
  * @param request GetGroupMemberByIdsRequest
  * @return GetGroupMemberByIdsResponse
 */
// Deprecated
async function getGroupMemberByIds(request: GetGroupMemberByIdsRequest): GetGroupMemberByIdsResponse {
  var runtime = new Util.RuntimeOptions{};
  return getGroupMemberByIdsWithOptions(request, runtime);
}

model GetIMConfigRequest {
  appId?: string(name='AppId', example='aaa111'),
}

model GetIMConfigResponseBody = {
  code?: string(name='Code', example='0'),
  httpStatusCode?: int32(name='HttpStatusCode', example='200'),
  messaage?: string(name='Messaage', example='error'),
  requestId?: string(name='RequestId'),
  result?: {
    imConfig?: {
      callbackConfig?: {
        apis?: map[string]boolean(name='Apis'),
        callbackUrl?: string(name='CallbackUrl', example='http://test.com'),
        events?: map[string]boolean(name='Events'),
        signatureKey?: string(name='SignatureKey', example='apitest_0'),
        signatureValue?: string(name='SignatureValue', example='sfwefwefwef'),
        spis?: map[string]boolean(name='Spis'),
      }(name='CallbackConfig'),
      msgConfig?: {
        clientMsgRecallTimeIntervalMinute?: long(name='ClientMsgRecallTimeIntervalMinute', example='2'),
      }(name='MsgConfig'),
    }(name='ImConfig'),
  }(name='Result'),
  success?: boolean(name='Success', example='true'),
}

model GetIMConfigResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetIMConfigResponseBody(name='body'),
}

/**
  * @deprecated
  *
  * @param request GetIMConfigRequest
  * @param runtime runtime options for this request RuntimeOptions
  * @return GetIMConfigResponse
 */
// Deprecated
async function getIMConfigWithOptions(request: GetIMConfigRequest, runtime: Util.RuntimeOptions): GetIMConfigResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetIMConfig',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
  * @deprecated
  *
  * @param request GetIMConfigRequest
  * @return GetIMConfigResponse
 */
// Deprecated
async function getIMConfig(request: GetIMConfigRequest): GetIMConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return getIMConfigWithOptions(request, runtime);
}

model GetLoginTokenRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    appKey?: string(name='AppKey', example='649b79ab544d737fe9e0bc6c67cf****'),
    appUid?: string(name='AppUid', example='95000****'),
    deviceId?: string(name='DeviceId', example='iOS_Device_F8594F51-FA81-470F-AAD9-6E254B77****'),
  }(name='RequestParams'),
}

model GetLoginTokenShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model GetLoginTokenResponseBody = {
  code?: string(name='Code', example='0'),
  message?: string(name='Message', example='Error Message'),
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378****'),
  result?: {
    accessToken?: string(name='AccessToken', example='EwOmBL8hRycisMQOw9hZppkd1ng4styC1KYAUtzzkqRTYWIE3uOSPkc3pcqEhOPtAIS4N825n4eee29sUwkV****'),
    accessTokenExpiredTime?: long(name='AccessTokenExpiredTime', example='86400000'),
    refreshToken?: string(name='RefreshToken', example='oauth_k1:rPIULQBrIpwxdhQCa5XPu17+t0vgwnzkJSLoc5hKe+6o/RAiuXPNQ7DfKiIL0V92I0sWZe/WOoEw9H86EqrT****'),
  }(name='Result'),
}

model GetLoginTokenResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetLoginTokenResponseBody(name='body'),
}

async function getLoginTokenWithOptions(tmpReq: GetLoginTokenRequest, runtime: Util.RuntimeOptions): GetLoginTokenResponse {
  Util.validateModel(tmpReq);
  var request = new GetLoginTokenShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetLoginToken',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getLoginToken(request: GetLoginTokenRequest): GetLoginTokenResponse {
  var runtime = new Util.RuntimeOptions{};
  return getLoginTokenWithOptions(request, runtime);
}

model GetMediaUploadUrlRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    mimeType?: string(name='MimeType', example='jpg'),
  }(name='RequestParams'),
}

model GetMediaUploadUrlShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model GetMediaUploadUrlResponseBody = {
  code?: string(name='Code', example='General.SystemError'),
  message?: string(name='Message', example='System Error'),
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378F720'),
  result?: {
    mediaId?: string(name='MediaId', example='$iQEMAqNqcGcDAQTNAyAFzQJYBtoAIYQBpAuf1dQCqrY4aIGemoBLONIDzwAAAXazCVSoBM0NyAcACA****'),
    uploadUrl?: string(name='UploadUrl', example='http://oss-aaajff.aliyun.com/aa****'),
  }(name='Result'),
}

model GetMediaUploadUrlResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetMediaUploadUrlResponseBody(name='body'),
}

async function getMediaUploadUrlWithOptions(tmpReq: GetMediaUploadUrlRequest, runtime: Util.RuntimeOptions): GetMediaUploadUrlResponse {
  Util.validateModel(tmpReq);
  var request = new GetMediaUploadUrlShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetMediaUploadUrl',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getMediaUploadUrl(request: GetMediaUploadUrlRequest): GetMediaUploadUrlResponse {
  var runtime = new Util.RuntimeOptions{};
  return getMediaUploadUrlWithOptions(request, runtime);
}

model GetMediaUrlRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    mediaId?: string(name='MediaId', example='$iQEMAqNqcGcDAQTNAyAFzQJYBtoAIYQBpAuf1dQCqrY4aIGemoBLONIDzwAAAXazCVSoBM0NyAcACA****'),
    urlExpireTime?: long(name='UrlExpireTime', example='300'),
  }(name='RequestParams'),
}

model GetMediaUrlShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model GetMediaUrlResponseBody = {
  code?: string(name='Code', example='Group.xxx'),
  message?: string(name='Message', example='Error Message'),
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378F720'),
  result?: {
    url?: string(name='Url', example='http://wu****-file-test.aliyuncs.com/ddmedia/mediaId.type?OSSAccessKeyId=ossak&Signature=sign%3D&Expires=160983****'),
  }(name='Result'),
}

model GetMediaUrlResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetMediaUrlResponseBody(name='body'),
}

async function getMediaUrlWithOptions(tmpReq: GetMediaUrlRequest, runtime: Util.RuntimeOptions): GetMediaUrlResponse {
  Util.validateModel(tmpReq);
  var request = new GetMediaUrlShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetMediaUrl',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getMediaUrl(request: GetMediaUrlRequest): GetMediaUrlResponse {
  var runtime = new Util.RuntimeOptions{};
  return getMediaUrlWithOptions(request, runtime);
}

model GetMessageByIdRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    msgId?: string(name='MsgId', example='123.EAUNIT'),
  }(name='RequestParams'),
}

model GetMessageByIdShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model GetMessageByIdResponseBody = {
  code?: string(name='Code', example='General.SystemError'),
  message?: string(name='Message', example='System Error'),
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378F720'),
  result?: {
    appCid?: string(name='AppCid', example='$1$125:888'),
    content?: string(name='Content', example='{"text": "hello"}'),
    contentType?: int32(name='ContentType', example='1'),
    conversationType?: int32(name='ConversationType', example='1'),
    createTime?: long(name='CreateTime', example='1588999999'),
    extensions?: map[string]string(name='Extensions'),
    msgId?: string(name='MsgId', example='12345$PNM'),
    senderId?: string(name='SenderId', example='125'),
  }(name='Result'),
}

model GetMessageByIdResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetMessageByIdResponseBody(name='body'),
}

async function getMessageByIdWithOptions(tmpReq: GetMessageByIdRequest, runtime: Util.RuntimeOptions): GetMessageByIdResponse {
  Util.validateModel(tmpReq);
  var request = new GetMessageByIdShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetMessageById',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getMessageById(request: GetMessageByIdRequest): GetMessageByIdResponse {
  var runtime = new Util.RuntimeOptions{};
  return getMessageByIdWithOptions(request, runtime);
}

model GetRoomStatisticsRequest {
  request?: {
    domain?: string(name='Domain', example='7m***q'),
    roomId?: string(name='RoomId', example='9645**c180a1'),
  }(name='Request'),
}

model GetRoomStatisticsResponseBody = {
  errorCode?: string(name='ErrorCode', example='1000'),
  errorMessage?: string(name='ErrorMessage', example='internal error'),
  requestId?: string(name='RequestId', example='FE22D613-D3C6-4A58-87CA-F21FC85AA08E'),
  responseSuccess?: boolean(name='ResponseSuccess', example='true'),
  result?: {
    onlineCount?: int32(name='OnlineCount', example='100'),
    PV?: int32(name='PV', example='100'),
    UV?: int32(name='UV', example='100'),
  }(name='Result'),
}

model GetRoomStatisticsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetRoomStatisticsResponseBody(name='body'),
}

async function getRoomStatisticsWithOptions(request: GetRoomStatisticsRequest, runtime: Util.RuntimeOptions): GetRoomStatisticsResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  var bodyFlat : map[string]any = {};
  if (!Util.isUnset(request.request)) {
    bodyFlat['Request'] = request.request;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetRoomStatistics',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function getRoomStatistics(request: GetRoomStatisticsRequest): GetRoomStatisticsResponse {
  var runtime = new Util.RuntimeOptions{};
  return getRoomStatisticsWithOptions(request, runtime);
}

model GetUserMuteSettingRequest {
  appId?: string(name='AppId'),
  requestParams?: {
    appUids?: [ string ](name='AppUids'),
  }(name='RequestParams'),
}

model GetUserMuteSettingShrinkRequest {
  appId?: string(name='AppId'),
  requestParamsShrink?: string(name='RequestParams'),
}

model GetUserMuteSettingResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  result?: {
    userMuteSettings?: map[string]ResultUserMuteSettingsValue(name='UserMuteSettings'),
  }(name='Result'),
}

model GetUserMuteSettingResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: GetUserMuteSettingResponseBody(name='body'),
}

/**
  * @deprecated
  *
  * @param tmpReq GetUserMuteSettingRequest
  * @param runtime runtime options for this request RuntimeOptions
  * @return GetUserMuteSettingResponse
 */
// Deprecated
async function getUserMuteSettingWithOptions(tmpReq: GetUserMuteSettingRequest, runtime: Util.RuntimeOptions): GetUserMuteSettingResponse {
  Util.validateModel(tmpReq);
  var request = new GetUserMuteSettingShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'GetUserMuteSetting',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
  * @deprecated
  *
  * @param request GetUserMuteSettingRequest
  * @return GetUserMuteSettingResponse
 */
// Deprecated
async function getUserMuteSetting(request: GetUserMuteSettingRequest): GetUserMuteSettingResponse {
  var runtime = new Util.RuntimeOptions{};
  return getUserMuteSettingWithOptions(request, runtime);
}

model ImportGroupChatConversationRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    createTime?: long(name='CreateTime', example='1613700223555'),
    extensions?: map[string]string(name='Extensions'),
    iconMediaId?: string(name='IconMediaId', example='$iQEMAqNqcGcDAQTNAyAFzQJYBtoAIYQBpAuf1dQCqrY4aIGemoBLONIDzwAAAXazCVSoBM0NyAcACA****'),
    memberLimit?: long(name='MemberLimit', example='50'),
    ownerAppUid?: string(name='OwnerAppUid', example='123'),
    silenceAll?: boolean(name='SilenceAll', example='false'),
    title?: string(name='Title', example='群标题'),
    uuid?: string(name='Uuid', example='123456'),
  }(name='RequestParams'),
}

model ImportGroupChatConversationShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model ImportGroupChatConversationResponseBody = {
  code?: string(name='Code', example='General.SystemError'),
  message?: string(name='Message', example='System Error'),
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378F720'),
  result?: {
    appCid?: string(name='AppCid', example='$2$12345'),
  }(name='Result'),
}

model ImportGroupChatConversationResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ImportGroupChatConversationResponseBody(name='body'),
}

async function importGroupChatConversationWithOptions(tmpReq: ImportGroupChatConversationRequest, runtime: Util.RuntimeOptions): ImportGroupChatConversationResponse {
  Util.validateModel(tmpReq);
  var request = new ImportGroupChatConversationShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ImportGroupChatConversation',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function importGroupChatConversation(request: ImportGroupChatConversationRequest): ImportGroupChatConversationResponse {
  var runtime = new Util.RuntimeOptions{};
  return importGroupChatConversationWithOptions(request, runtime);
}

model ImportGroupChatMemberRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    appCid?: string(name='AppCid', example='$2$123456'),
    groupChatMembers?: [ 
      {
        appUid?: string(name='AppUid', example='123'),
        extensions?: map[string]string(name='Extensions'),
        joinTime?: long(name='JoinTime', example='1613700223555'),
        modifyTime?: long(name='ModifyTime', example='1613700223555'),
        mute?: boolean(name='Mute', example='false'),
        nick?: string(name='Nick', example='bob'),
        redPoint?: long(name='RedPoint', example='1'),
        role?: long(name='Role', example='3'),
        top?: boolean(name='Top', example='false'),
        visible?: boolean(name='Visible', example='true'),
      }
    ](name='GroupChatMembers'),
  }(name='RequestParams'),
}

model ImportGroupChatMemberShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model ImportGroupChatMemberResponseBody = {
  code?: string(name='Code', example='General.SystemError'),
  message?: string(name='Message', example='System Error'),
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378F720'),
}

model ImportGroupChatMemberResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ImportGroupChatMemberResponseBody(name='body'),
}

async function importGroupChatMemberWithOptions(tmpReq: ImportGroupChatMemberRequest, runtime: Util.RuntimeOptions): ImportGroupChatMemberResponse {
  Util.validateModel(tmpReq);
  var request = new ImportGroupChatMemberShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ImportGroupChatMember',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function importGroupChatMember(request: ImportGroupChatMemberRequest): ImportGroupChatMemberResponse {
  var runtime = new Util.RuntimeOptions{};
  return importGroupChatMemberWithOptions(request, runtime);
}

model ImportMessageRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    messages?: [ 
      {
        appCid?: string(name='AppCid', example='$1$123:124'),
        content?: string(name='Content', example='{"text": "hello"}'),
        contentType?: long(name='ContentType', example='1'),
        conversationType?: long(name='ConversationType', example='1'),
        createTime?: long(name='CreateTime', example='1613700223555'),
        extensions?: map[string]string(name='Extensions'),
        receiverIds?: [ string ](name='ReceiverIds', example='1'),
        senderId?: string(name='SenderId', example='123'),
        uuid?: string(name='Uuid', example='123999992222'),
      }
    ](name='Messages'),
  }(name='RequestParams'),
}

model ImportMessageShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model ImportMessageResponseBody = {
  code?: string(name='Code', example='General.SystemError'),
  message?: string(name='Message', example='System Error'),
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378F720'),
  result?: {
    importMessageResult?: map[string]ResultImportMessageResultValue(name='ImportMessageResult'),
  }(name='Result'),
}

model ImportMessageResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ImportMessageResponseBody(name='body'),
}

async function importMessageWithOptions(tmpReq: ImportMessageRequest, runtime: Util.RuntimeOptions): ImportMessageResponse {
  Util.validateModel(tmpReq);
  var request = new ImportMessageShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ImportMessage',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function importMessage(request: ImportMessageRequest): ImportMessageResponse {
  var runtime = new Util.RuntimeOptions{};
  return importMessageWithOptions(request, runtime);
}

model ImportSingleConversationRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    conversation?: {
      appCid?: string(name='AppCid', example='$1$123:123'),
      appUids?: [ string ](name='AppUids'),
      createTime?: long(name='CreateTime', example='1613700223555'),
      extensions?: map[string]string(name='Extensions'),
    }(name='Conversation'),
    userConversations?: map[string]RequestParamsUserConversationsValue(name='UserConversations'),
  }(name='RequestParams'),
}

model ImportSingleConversationShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model ImportSingleConversationResponseBody = {
  code?: string(name='Code', example='General.SystemError'),
  message?: string(name='Message', example='System Error'),
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378F720'),
}

model ImportSingleConversationResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ImportSingleConversationResponseBody(name='body'),
}

async function importSingleConversationWithOptions(tmpReq: ImportSingleConversationRequest, runtime: Util.RuntimeOptions): ImportSingleConversationResponse {
  Util.validateModel(tmpReq);
  var request = new ImportSingleConversationShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ImportSingleConversation',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function importSingleConversation(request: ImportSingleConversationRequest): ImportSingleConversationResponse {
  var runtime = new Util.RuntimeOptions{};
  return importSingleConversationWithOptions(request, runtime);
}

model InitTenantRequest {
  request?: {
    domain?: string(name='domain', example='testAppKey'),
  }(name='Request'),
}

model InitTenantResponseBody = {
  requestId?: string(name='RequestId'),
  responseSuccess?: boolean(name='ResponseSuccess'),
  errorCode?: string(name='errorCode', example='1001'),
  errorMsg?: string(name='errorMsg', example='参数错误'),
  result?: boolean(name='result', example='true'),
}

model InitTenantResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: InitTenantResponseBody(name='body'),
}

/**
  * @deprecated
  *
  * @param request InitTenantRequest
  * @param runtime runtime options for this request RuntimeOptions
  * @return InitTenantResponse
 */
// Deprecated
async function initTenantWithOptions(request: InitTenantRequest, runtime: Util.RuntimeOptions): InitTenantResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  var bodyFlat : map[string]any = {};
  if (!Util.isUnset(request.request)) {
    bodyFlat['Request'] = request.request;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'InitTenant',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
  * @deprecated
  *
  * @param request InitTenantRequest
  * @return InitTenantResponse
 */
// Deprecated
async function initTenant(request: InitTenantRequest): InitTenantResponse {
  var runtime = new Util.RuntimeOptions{};
  return initTenantWithOptions(request, runtime);
}

model KickOffRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    appKeys?: [ string ](name='AppKeys'),
    appUid?: string(name='AppUid', example='950000010'),
    information?: string(name='Information', example='已被系统强制下线'),
  }(name='RequestParams'),
}

model KickOffShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model KickOffResponseBody = {
  code?: string(name='Code', example='User.xxx'),
  message?: string(name='Message', example='Error Message'),
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378F720'),
}

model KickOffResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: KickOffResponseBody(name='body'),
}

async function kickOffWithOptions(tmpReq: KickOffRequest, runtime: Util.RuntimeOptions): KickOffResponse {
  Util.validateModel(tmpReq);
  var request = new KickOffShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'KickOff',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function kickOff(request: KickOffRequest): KickOffResponse {
  var runtime = new Util.RuntimeOptions{};
  return kickOffWithOptions(request, runtime);
}

model ListAppInfosRequest {
  requestParams?: {
    keyword?: string(name='Keyword', example='test'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='10'),
    type?: string(name='Type', example='appName'),
  }(name='RequestParams'),
}

model ListAppInfosShrinkRequest {
  requestParamsShrink?: string(name='RequestParams'),
}

model ListAppInfosResponseBody = {
  code?: string(name='Code', description='code', example='502'),
  httpStatusCode?: int32(name='HttpStatusCode', description='httpStatusCode', example='200'),
  message?: string(name='Message', description='desc', example='Success'),
  requestId?: string(name='RequestId', description='requestId', example='11134455'),
  result?: {
    appInfos?: [ 
      {
        appId?: string(name='AppId', example='aaa111'),
        appName?: string(name='AppName', example='test name'),
        appStatus?: int32(name='AppStatus', example='1'),
        createTime?: string(name='CreateTime', example='2020-10-10 22:24:09'),
        instanceId?: string(name='InstanceId', example='live-producer-public-cn_23343'),
        prodVersion?: string(name='ProdVersion', example='BasicVersion'),
      }
    ](name='AppInfos'),
    totalCount?: int32(name='TotalCount', example='10'),
  }(name='Result', description='result'),
  success?: boolean(name='Success', description='success', example='true'),
}

model ListAppInfosResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListAppInfosResponseBody(name='body'),
}

/**
  * @deprecated
  *
  * @param tmpReq ListAppInfosRequest
  * @param runtime runtime options for this request RuntimeOptions
  * @return ListAppInfosResponse
 */
// Deprecated
async function listAppInfosWithOptions(tmpReq: ListAppInfosRequest, runtime: Util.RuntimeOptions): ListAppInfosResponse {
  Util.validateModel(tmpReq);
  var request = new ListAppInfosShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListAppInfos',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
  * @deprecated
  *
  * @param request ListAppInfosRequest
  * @return ListAppInfosResponse
 */
// Deprecated
async function listAppInfos(request: ListAppInfosRequest): ListAppInfosResponse {
  var runtime = new Util.RuntimeOptions{};
  return listAppInfosWithOptions(request, runtime);
}

model ListCallbackApiIdsResponseBody = {
  code?: string(name='Code', example='Portal.ParameterError'),
  httpStatusCode?: int32(name='HttpStatusCode', example='500'),
  message?: string(name='Message', example='error'),
  requestId?: string(name='RequestId', description='Id of the request', example='1113344'),
  result?: {
    events?: map[string]boolean(name='Events'),
    spis?: map[string]boolean(name='Spis'),
  }(name='Result'),
  success?: boolean(name='Success', example='true'),
}

model ListCallbackApiIdsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListCallbackApiIdsResponseBody(name='body'),
}

async function listCallbackApiIdsWithOptions(runtime: Util.RuntimeOptions): ListCallbackApiIdsResponse {
  var req = new OpenApi.OpenApiRequest{};
  var params = new OpenApi.Params{
    action = 'ListCallbackApiIds',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listCallbackApiIds(): ListCallbackApiIdsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listCallbackApiIdsWithOptions(runtime);
}

model ListDetailReportStatisticsRequest {
  appId?: string(name='AppId', example='aaa111'),
  requestParams?: {
    endTime?: string(name='EndTime', example='2020-01-12'),
    reportStatisticsType?: string(name='ReportStatisticsType', example='user'),
    startTime?: string(name='StartTime', example='2020-01-01'),
  }(name='RequestParams'),
}

model ListDetailReportStatisticsShrinkRequest {
  appId?: string(name='AppId', example='aaa111'),
  requestParamsShrink?: string(name='RequestParams'),
}

model ListDetailReportStatisticsResponseBody = {
  code?: string(name='Code', description='code', example='502'),
  httpStatusCode?: int32(name='HttpStatusCode', description='httpStatusCode', example='200'),
  message?: string(name='Message', description='desc', example='Success'),
  requestId?: string(name='RequestId', description='requestId', example='12345'),
  result?: {
    data?: [  map[string]any ](name='Data'),
  }(name='Result', description='result'),
  success?: boolean(name='Success', description='success', example='false'),
}

model ListDetailReportStatisticsResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListDetailReportStatisticsResponseBody(name='body'),
}

async function listDetailReportStatisticsWithOptions(tmpReq: ListDetailReportStatisticsRequest, runtime: Util.RuntimeOptions): ListDetailReportStatisticsResponse {
  Util.validateModel(tmpReq);
  var request = new ListDetailReportStatisticsShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListDetailReportStatistics',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listDetailReportStatistics(request: ListDetailReportStatisticsRequest): ListDetailReportStatisticsResponse {
  var runtime = new Util.RuntimeOptions{};
  return listDetailReportStatisticsWithOptions(request, runtime);
}

model ListGroupAllMembersRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    appCid?: string(name='AppCid', example='$2$11222333'),
  }(name='RequestParams'),
}

model ListGroupAllMembersShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model ListGroupAllMembersResponseBody = {
  code?: string(name='Code', example='General.SystemError'),
  message?: string(name='Message', example='System Error'),
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378F720'),
  result?: {
    members?: [ 
      {
        appUid?: string(name='AppUid', example='123333'),
        extensions?: map[string]string(name='Extensions'),
        joinTime?: long(name='JoinTime', example='1233333332'),
        nick?: string(name='Nick', example='testNick'),
        role?: int32(name='Role', example='1-群主；2-管理员；3-普通'),
      }
    ](name='Members'),
  }(name='Result'),
}

model ListGroupAllMembersResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListGroupAllMembersResponseBody(name='body'),
}

async function listGroupAllMembersWithOptions(tmpReq: ListGroupAllMembersRequest, runtime: Util.RuntimeOptions): ListGroupAllMembersResponse {
  Util.validateModel(tmpReq);
  var request = new ListGroupAllMembersShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListGroupAllMembers',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listGroupAllMembers(request: ListGroupAllMembersRequest): ListGroupAllMembersResponse {
  var runtime = new Util.RuntimeOptions{};
  return listGroupAllMembersWithOptions(request, runtime);
}

model ListGroupSilenceMembersRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    appCid?: string(name='AppCid', example='12345678'),
    operatorAppUid?: string(name='OperatorAppUid', example='123'),
  }(name='RequestParams'),
}

model ListGroupSilenceMembersShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model ListGroupSilenceMembersResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
  result?: {
    appCid?: string(name='AppCid'),
    blacklist?: map[string]long(name='Blacklist'),
    whitelist?: [ string ](name='Whitelist'),
  }(name='Result'),
}

model ListGroupSilenceMembersResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListGroupSilenceMembersResponseBody(name='body'),
}

/**
  * @deprecated
  *
  * @param tmpReq ListGroupSilenceMembersRequest
  * @param runtime runtime options for this request RuntimeOptions
  * @return ListGroupSilenceMembersResponse
 */
// Deprecated
async function listGroupSilenceMembersWithOptions(tmpReq: ListGroupSilenceMembersRequest, runtime: Util.RuntimeOptions): ListGroupSilenceMembersResponse {
  Util.validateModel(tmpReq);
  var request = new ListGroupSilenceMembersShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListGroupSilenceMembers',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
  * @deprecated
  *
  * @param request ListGroupSilenceMembersRequest
  * @return ListGroupSilenceMembersResponse
 */
// Deprecated
async function listGroupSilenceMembers(request: ListGroupSilenceMembersRequest): ListGroupSilenceMembersResponse {
  var runtime = new Util.RuntimeOptions{};
  return listGroupSilenceMembersWithOptions(request, runtime);
}

model ListRoomMessagesRequest {
  request?: {
    domain?: string(name='Domain', example='7m***q'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='100'),
    roomId?: string(name='RoomId', example='9645**c180a1'),
    subType?: int32(name='SubType', example='100001'),
  }(name='Request'),
}

model ListRoomMessagesResponseBody = {
  errorCode?: string(name='ErrorCode', example='1000'),
  errorMessage?: string(name='ErrorMessage', example='internal error'),
  requestId?: string(name='RequestId', example='FE22D613-D3C6-4A58-87CA-F21FC85AA08E'),
  responseSuccess?: boolean(name='ResponseSuccess', example='true'),
  result?: {
    hasMore?: boolean(name='HasMore', example='true'),
    roomMessageList?: [ 
      {
        body?: string(name='Body', example='Hello,World'),
        messageId?: string(name='MessageId', example='0io**Fs6Q384'),
        roomId?: string(name='RoomId', example='9645**c180a1'),
        sendTimeMillis?: long(name='SendTimeMillis', example='1625125505079'),
        senderId?: string(name='SenderId', example='62***59'),
        subType?: int32(name='SubType', example='100001'),
      }
    ](name='RoomMessageList', example='testRoomId'),
    totalCount?: int32(name='TotalCount', example='100'),
  }(name='Result'),
}

model ListRoomMessagesResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListRoomMessagesResponseBody(name='body'),
}

async function listRoomMessagesWithOptions(request: ListRoomMessagesRequest, runtime: Util.RuntimeOptions): ListRoomMessagesResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  var bodyFlat : map[string]any = {};
  if (!Util.isUnset(request.request)) {
    bodyFlat['Request'] = request.request;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListRoomMessages',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listRoomMessages(request: ListRoomMessagesRequest): ListRoomMessagesResponse {
  var runtime = new Util.RuntimeOptions{};
  return listRoomMessagesWithOptions(request, runtime);
}

model ListRoomUsersRequest {
  request?: {
    domain?: string(name='Domain', example='7m***q'),
    pageNumber?: int32(name='PageNumber', example='1'),
    pageSize?: int32(name='PageSize', example='100'),
    roomId?: string(name='RoomId', example='9645**c180a1'),
  }(name='Request'),
}

model ListRoomUsersResponseBody = {
  errorCode?: string(name='ErrorCode', example='1000'),
  errorMessage?: string(name='ErrorMessage', example='internal error'),
  requestId?: string(name='RequestId', example='FE22D613-D3C6-4A58-87CA-F21FC85AA08E'),
  responseSuccess?: boolean(name='ResponseSuccess', example='true'),
  result?: {
    hasMore?: boolean(name='HasMore', example='true'),
    roomUserVOList?: [ 
      {
        nick?: string(name='Nick', example='Tom'),
        roomId?: string(name='RoomId', example='9645**c180a1'),
        userId?: string(name='UserId', example='62**59'),
      }
    ](name='RoomUserVOList'),
    totalCount?: int32(name='TotalCount', example='100'),
  }(name='Result'),
}

model ListRoomUsersResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: ListRoomUsersResponseBody(name='body'),
}

async function listRoomUsersWithOptions(request: ListRoomUsersRequest, runtime: Util.RuntimeOptions): ListRoomUsersResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  var bodyFlat : map[string]any = {};
  if (!Util.isUnset(request.request)) {
    bodyFlat['Request'] = request.request;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'ListRoomUsers',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function listRoomUsers(request: ListRoomUsersRequest): ListRoomUsersResponse {
  var runtime = new Util.RuntimeOptions{};
  return listRoomUsersWithOptions(request, runtime);
}

model MuteUsersRequest {
  appId?: string(name='AppId'),
  requestParams?: {
    appUids?: [ string ](name='AppUids'),
    mute?: boolean(name='Mute', example='true'),
    muteDuration?: long(name='MuteDuration', example='100'),
  }(name='RequestParams'),
}

model MuteUsersShrinkRequest {
  appId?: string(name='AppId'),
  requestParamsShrink?: string(name='RequestParams'),
}

model MuteUsersResponseBody = {
  code?: string(name='Code'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId'),
}

model MuteUsersResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: MuteUsersResponseBody(name='body'),
}

/**
  * @deprecated
  *
  * @param tmpReq MuteUsersRequest
  * @param runtime runtime options for this request RuntimeOptions
  * @return MuteUsersResponse
 */
// Deprecated
async function muteUsersWithOptions(tmpReq: MuteUsersRequest, runtime: Util.RuntimeOptions): MuteUsersResponse {
  Util.validateModel(tmpReq);
  var request = new MuteUsersShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'MuteUsers',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
  * @deprecated
  *
  * @param request MuteUsersRequest
  * @return MuteUsersResponse
 */
// Deprecated
async function muteUsers(request: MuteUsersRequest): MuteUsersResponse {
  var runtime = new Util.RuntimeOptions{};
  return muteUsersWithOptions(request, runtime);
}

model QueryInterconnectionCidMappingRequest {
  appId?: string(name='AppId', description='AppId', example='apitest'),
  requestParams?: {
    srcCid?: string(name='SrcCid'),
    type?: long(name='Type', example='1'),
  }(name='RequestParams'),
}

model QueryInterconnectionCidMappingShrinkRequest {
  appId?: string(name='AppId', description='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model QueryInterconnectionCidMappingResponseBody = {
  code?: string(name='Code', example='200'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='1122'),
  result?: {
    dstCid?: string(name='DstCid', example='1111'),
  }(name='Result'),
}

model QueryInterconnectionCidMappingResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: QueryInterconnectionCidMappingResponseBody(name='body'),
}

/**
  * @deprecated
  *
  * @param tmpReq QueryInterconnectionCidMappingRequest
  * @param runtime runtime options for this request RuntimeOptions
  * @return QueryInterconnectionCidMappingResponse
 */
// Deprecated
async function queryInterconnectionCidMappingWithOptions(tmpReq: QueryInterconnectionCidMappingRequest, runtime: Util.RuntimeOptions): QueryInterconnectionCidMappingResponse {
  Util.validateModel(tmpReq);
  var request = new QueryInterconnectionCidMappingShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'QueryInterconnectionCidMapping',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
  * @deprecated
  *
  * @param request QueryInterconnectionCidMappingRequest
  * @return QueryInterconnectionCidMappingResponse
 */
// Deprecated
async function queryInterconnectionCidMapping(request: QueryInterconnectionCidMappingRequest): QueryInterconnectionCidMappingResponse {
  var runtime = new Util.RuntimeOptions{};
  return queryInterconnectionCidMappingWithOptions(request, runtime);
}

model RecallMessageRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    appCid?: string(name='AppCid', example='28017165705'),
    appUid?: string(name='AppUid', example='950000010'),
    extensions?: map[string]string(name='Extensions'),
    msgId?: string(name='MsgId', example='28017165705.center_daily'),
    operatorType?: int32(name='OperatorType', example='0'),
    type?: int32(name='Type', example='0'),
  }(name='RequestParams'),
}

model RecallMessageShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model RecallMessageResponseBody = {
  code?: string(name='Code', example='User.xxx'),
  message?: string(name='Message', example='System Error'),
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378F720'),
}

model RecallMessageResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RecallMessageResponseBody(name='body'),
}

async function recallMessageWithOptions(tmpReq: RecallMessageRequest, runtime: Util.RuntimeOptions): RecallMessageResponse {
  Util.validateModel(tmpReq);
  var request = new RecallMessageShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RecallMessage',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function recallMessage(request: RecallMessageRequest): RecallMessageResponse {
  var runtime = new Util.RuntimeOptions{};
  return recallMessageWithOptions(request, runtime);
}

model RemoveGroupExtensionByKeysRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    appCid?: string(name='AppCid', example='$2$111000'),
    keys?: [ string ](name='Keys'),
  }(name='RequestParams'),
}

model RemoveGroupExtensionByKeysShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model RemoveGroupExtensionByKeysResponseBody = {
  code?: string(name='Code', example='User.xxx'),
  message?: string(name='Message', example='System Error'),
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378F720'),
}

model RemoveGroupExtensionByKeysResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RemoveGroupExtensionByKeysResponseBody(name='body'),
}

async function removeGroupExtensionByKeysWithOptions(tmpReq: RemoveGroupExtensionByKeysRequest, runtime: Util.RuntimeOptions): RemoveGroupExtensionByKeysResponse {
  Util.validateModel(tmpReq);
  var request = new RemoveGroupExtensionByKeysShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RemoveGroupExtensionByKeys',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function removeGroupExtensionByKeys(request: RemoveGroupExtensionByKeysRequest): RemoveGroupExtensionByKeysResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeGroupExtensionByKeysWithOptions(request, runtime);
}

model RemoveGroupMemberExtensionByKeysRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    appCid?: string(name='AppCid', example='$2$11222333'),
    appUid?: string(name='AppUid', example='11112'),
    keys?: [ string ](name='Keys'),
  }(name='RequestParams'),
}

model RemoveGroupMemberExtensionByKeysShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model RemoveGroupMemberExtensionByKeysResponseBody = {
  code?: string(name='Code', example='General.SystemError'),
  message?: string(name='Message', example='System Error'),
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378F720'),
}

model RemoveGroupMemberExtensionByKeysResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RemoveGroupMemberExtensionByKeysResponseBody(name='body'),
}

async function removeGroupMemberExtensionByKeysWithOptions(tmpReq: RemoveGroupMemberExtensionByKeysRequest, runtime: Util.RuntimeOptions): RemoveGroupMemberExtensionByKeysResponse {
  Util.validateModel(tmpReq);
  var request = new RemoveGroupMemberExtensionByKeysShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RemoveGroupMemberExtensionByKeys',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function removeGroupMemberExtensionByKeys(request: RemoveGroupMemberExtensionByKeysRequest): RemoveGroupMemberExtensionByKeysResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeGroupMemberExtensionByKeysWithOptions(request, runtime);
}

model RemoveGroupMembersRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    appCid?: string(name='AppCid', example='$2$111000'),
    appUidsRemoved?: [ string ](name='AppUidsRemoved'),
    operatorAppUid?: string(name='OperatorAppUid', example='888666'),
  }(name='RequestParams'),
}

model RemoveGroupMembersShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model RemoveGroupMembersResponseBody = {
  code?: string(name='Code', example='User.xxx'),
  message?: string(name='Message', example='System Error'),
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378F720'),
}

model RemoveGroupMembersResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RemoveGroupMembersResponseBody(name='body'),
}

async function removeGroupMembersWithOptions(tmpReq: RemoveGroupMembersRequest, runtime: Util.RuntimeOptions): RemoveGroupMembersResponse {
  Util.validateModel(tmpReq);
  var request = new RemoveGroupMembersShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RemoveGroupMembers',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function removeGroupMembers(request: RemoveGroupMembersRequest): RemoveGroupMembersResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeGroupMembersWithOptions(request, runtime);
}

model RemoveGroupSilenceBlacklistRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    appCid?: string(name='AppCid', example='$2$12345678'),
    members?: [ string ](name='Members'),
    operatorAppUid?: string(name='OperatorAppUid', example='123'),
  }(name='RequestParams', example='apitest'),
}

model RemoveGroupSilenceBlacklistShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams', example='apitest'),
}

model RemoveGroupSilenceBlacklistResponseBody = {
  code?: string(name='Code', example='General.SystemError'),
  message?: string(name='Message', example='System Error'),
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378F720'),
}

model RemoveGroupSilenceBlacklistResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RemoveGroupSilenceBlacklistResponseBody(name='body'),
}

async function removeGroupSilenceBlacklistWithOptions(tmpReq: RemoveGroupSilenceBlacklistRequest, runtime: Util.RuntimeOptions): RemoveGroupSilenceBlacklistResponse {
  Util.validateModel(tmpReq);
  var request = new RemoveGroupSilenceBlacklistShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RemoveGroupSilenceBlacklist',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function removeGroupSilenceBlacklist(request: RemoveGroupSilenceBlacklistRequest): RemoveGroupSilenceBlacklistResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeGroupSilenceBlacklistWithOptions(request, runtime);
}

model RemoveGroupSilenceWhitelistRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    appCid?: string(name='AppCid', example='$2$12345678'),
    members?: [ string ](name='Members'),
    operatorAppUid?: string(name='OperatorAppUid', example='123'),
  }(name='RequestParams', example='apitest'),
}

model RemoveGroupSilenceWhitelistShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams', example='apitest'),
}

model RemoveGroupSilenceWhitelistResponseBody = {
  code?: string(name='Code', example='General.SystemError'),
  message?: string(name='Message', example='System Error'),
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378F720'),
}

model RemoveGroupSilenceWhitelistResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RemoveGroupSilenceWhitelistResponseBody(name='body'),
}

async function removeGroupSilenceWhitelistWithOptions(tmpReq: RemoveGroupSilenceWhitelistRequest, runtime: Util.RuntimeOptions): RemoveGroupSilenceWhitelistResponse {
  Util.validateModel(tmpReq);
  var request = new RemoveGroupSilenceWhitelistShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RemoveGroupSilenceWhitelist',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function removeGroupSilenceWhitelist(request: RemoveGroupSilenceWhitelistRequest): RemoveGroupSilenceWhitelistResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeGroupSilenceWhitelistWithOptions(request, runtime);
}

model RemoveMessageExtensionByKeysRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    appCid?: string(name='AppCid', example='$1$10010:10086****'),
    keys?: [ string ](name='Keys', example='key1'),
    msgId?: string(name='MsgId', example='123123.center_daily****'),
  }(name='RequestParams'),
}

model RemoveMessageExtensionByKeysShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model RemoveMessageExtensionByKeysResponseBody = {
  code?: string(name='Code', example='User.xxx'),
  message?: string(name='Message', example='Error Message'),
  requestId?: string(name='RequestId', example='788DABCD-A3CF-48B2-9F80-E57B41A2169A'),
}

model RemoveMessageExtensionByKeysResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RemoveMessageExtensionByKeysResponseBody(name='body'),
}

async function removeMessageExtensionByKeysWithOptions(tmpReq: RemoveMessageExtensionByKeysRequest, runtime: Util.RuntimeOptions): RemoveMessageExtensionByKeysResponse {
  Util.validateModel(tmpReq);
  var request = new RemoveMessageExtensionByKeysShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RemoveMessageExtensionByKeys',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function removeMessageExtensionByKeys(request: RemoveMessageExtensionByKeysRequest): RemoveMessageExtensionByKeysResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeMessageExtensionByKeysWithOptions(request, runtime);
}

model RemoveSingleChatExtensionByKeysRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    appCid?: string(name='AppCid', example='$1$10010:10086'),
    appUid?: string(name='AppUid', example='123456'),
    keys?: [ string ](name='Keys'),
  }(name='RequestParams'),
}

model RemoveSingleChatExtensionByKeysShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model RemoveSingleChatExtensionByKeysResponseBody = {
  code?: string(name='Code', example='General.SystemError'),
  message?: string(name='Message', example='System Error'),
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378F720'),
}

model RemoveSingleChatExtensionByKeysResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RemoveSingleChatExtensionByKeysResponseBody(name='body'),
}

async function removeSingleChatExtensionByKeysWithOptions(tmpReq: RemoveSingleChatExtensionByKeysRequest, runtime: Util.RuntimeOptions): RemoveSingleChatExtensionByKeysResponse {
  Util.validateModel(tmpReq);
  var request = new RemoveSingleChatExtensionByKeysShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RemoveSingleChatExtensionByKeys',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function removeSingleChatExtensionByKeys(request: RemoveSingleChatExtensionByKeysRequest): RemoveSingleChatExtensionByKeysResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeSingleChatExtensionByKeysWithOptions(request, runtime);
}

model RemoveUserConversationExtensionByKeysRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    appCid?: string(name='AppCid', example='$1$10010:10086'),
    appUid?: string(name='AppUid', example='123456'),
    keys?: [ string ](name='Keys'),
  }(name='RequestParams'),
}

model RemoveUserConversationExtensionByKeysShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model RemoveUserConversationExtensionByKeysResponseBody = {
  code?: string(name='Code', example='General.SystemError'),
  message?: string(name='Message', example='System Error'),
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378F720'),
}

model RemoveUserConversationExtensionByKeysResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: RemoveUserConversationExtensionByKeysResponseBody(name='body'),
}

async function removeUserConversationExtensionByKeysWithOptions(tmpReq: RemoveUserConversationExtensionByKeysRequest, runtime: Util.RuntimeOptions): RemoveUserConversationExtensionByKeysResponse {
  Util.validateModel(tmpReq);
  var request = new RemoveUserConversationExtensionByKeysShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'RemoveUserConversationExtensionByKeys',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function removeUserConversationExtensionByKeys(request: RemoveUserConversationExtensionByKeysRequest): RemoveUserConversationExtensionByKeysResponse {
  var runtime = new Util.RuntimeOptions{};
  return removeUserConversationExtensionByKeysWithOptions(request, runtime);
}

model SendCustomMessageRequest {
  request?: {
    body?: string(name='Body', example='Hello,World'),
    domain?: string(name='Domain', example='7m***q'),
    roomId?: string(name='RoomId', example='9645**c180a1'),
    senderId?: string(name='SenderId', example='62**59'),
    subType?: int32(name='SubType', example='100001'),
  }(name='Request'),
}

model SendCustomMessageResponseBody = {
  errorCode?: string(name='ErrorCode', example='1000'),
  errorMessage?: string(name='ErrorMessage', example='internal error'),
  requestId?: string(name='RequestId', example='FE22D613-D3C6-4A58-87CA-F21FC85AA08E'),
  responseSuccess?: boolean(name='ResponseSuccess', example='true'),
  result?: {
    messageId?: string(name='MessageId', example='0io**Fs6Q384'),
  }(name='Result'),
}

model SendCustomMessageResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SendCustomMessageResponseBody(name='body'),
}

async function sendCustomMessageWithOptions(request: SendCustomMessageRequest, runtime: Util.RuntimeOptions): SendCustomMessageResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  var bodyFlat : map[string]any = {};
  if (!Util.isUnset(request.request)) {
    bodyFlat['Request'] = request.request;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SendCustomMessage',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function sendCustomMessage(request: SendCustomMessageRequest): SendCustomMessageResponse {
  var runtime = new Util.RuntimeOptions{};
  return sendCustomMessageWithOptions(request, runtime);
}

model SendCustomMessageToRoomUsersRequest {
  receivers?: [ string ](name='Receivers'),
  request?: {
    body?: string(name='Body', example='Hello,World'),
    domain?: string(name='Domain', example='7m***q'),
    roomId?: string(name='RoomId', example='9645**c180a1'),
    senderId?: string(name='SenderId', example='62**59'),
    subType?: int32(name='SubType', example='100001'),
  }(name='Request'),
}

model SendCustomMessageToRoomUsersResponseBody = {
  errorCode?: string(name='ErrorCode', example='1000'),
  errorMessage?: string(name='ErrorMessage', example='internal error'),
  requestId?: string(name='RequestId', example='FE22D613-D3C6-4A58-87CA-F21FC85AA08E'),
  responseSuccess?: boolean(name='ResponseSuccess', example='true'),
  result?: {
    messageId?: string(name='MessageId', example='0io**Fs6Q384'),
  }(name='Result'),
}

model SendCustomMessageToRoomUsersResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SendCustomMessageToRoomUsersResponseBody(name='body'),
}

async function sendCustomMessageToRoomUsersWithOptions(request: SendCustomMessageToRoomUsersRequest, runtime: Util.RuntimeOptions): SendCustomMessageToRoomUsersResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  var bodyFlat : map[string]any = {};
  if (!Util.isUnset(request.receivers)) {
    bodyFlat['Receivers'] = request.receivers;
  }
  if (!Util.isUnset(request.request)) {
    bodyFlat['Request'] = request.request;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SendCustomMessageToRoomUsers',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function sendCustomMessageToRoomUsers(request: SendCustomMessageToRoomUsersRequest): SendCustomMessageToRoomUsersResponse {
  var runtime = new Util.RuntimeOptions{};
  return sendCustomMessageToRoomUsersWithOptions(request, runtime);
}

model SendMessageRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    appCid?: string(name='AppCid', example='$1$123:567'),
    content?: string(name='Content', example='{"text":"hello world"}'),
    contentType?: int32(name='ContentType', example='1'),
    conversationType?: int32(name='ConversationType', example='1'),
    extensions?: map[string]string(name='Extensions'),
    options?: {
      receiveScopeOption?: {
        excludeReceiverIds?: [ string ](name='ExcludeReceiverIds'),
        receiveScope?: int32(name='ReceiveScope', example='0'),
        receiverIds?: [ string ](name='ReceiverIds'),
      }(name='ReceiveScopeOption'),
      redPointPolicy?: int32(name='RedPointPolicy', example='0'),
      singleChatCreateRequest?: {
        appCid?: string(name='AppCid', example='$3$123:567'),
        appUids?: [ string ](name='AppUids'),
        extensions?: map[string]string(name='Extensions'),
        userConversation?: map[string]RequestParamsOptionsSingleChatCreateRequestUserConversationValue(name='UserConversation'),
      }(name='SingleChatCreateRequest'),
    }(name='Options'),
    senderId?: string(name='SenderId', example='950000010'),
    uuid?: string(name='Uuid', example='8c086146-889e-4642-b3d9-17e97ae6****'),
  }(name='RequestParams'),
}

model SendMessageShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model SendMessageResponseBody = {
  code?: string(name='Code', example='0'),
  message?: string(name='Message', example='""'),
  requestId?: string(name='RequestId', example='yiepfjeqa'),
  result?: {
    createTime?: long(name='CreateTime', example='1609763319539'),
    msgId?: string(name='MsgId', example='28017165705.center_daily'),
  }(name='Result'),
}

model SendMessageResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SendMessageResponseBody(name='body'),
}

async function sendMessageWithOptions(tmpReq: SendMessageRequest, runtime: Util.RuntimeOptions): SendMessageResponse {
  Util.validateModel(tmpReq);
  var request = new SendMessageShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SendMessage',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function sendMessage(request: SendMessageRequest): SendMessageResponse {
  var runtime = new Util.RuntimeOptions{};
  return sendMessageWithOptions(request, runtime);
}

model SetGroupExtensionByKeysRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    appCid?: string(name='AppCid', example='$2$111000'),
    extensions?: map[string]string(name='Extensions'),
  }(name='RequestParams'),
}

model SetGroupExtensionByKeysShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model SetGroupExtensionByKeysResponseBody = {
  code?: string(name='Code', example='User.xxx'),
  message?: string(name='Message', example='System Error'),
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378F720'),
}

model SetGroupExtensionByKeysResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetGroupExtensionByKeysResponseBody(name='body'),
}

async function setGroupExtensionByKeysWithOptions(tmpReq: SetGroupExtensionByKeysRequest, runtime: Util.RuntimeOptions): SetGroupExtensionByKeysResponse {
  Util.validateModel(tmpReq);
  var request = new SetGroupExtensionByKeysShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SetGroupExtensionByKeys',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setGroupExtensionByKeys(request: SetGroupExtensionByKeysRequest): SetGroupExtensionByKeysResponse {
  var runtime = new Util.RuntimeOptions{};
  return setGroupExtensionByKeysWithOptions(request, runtime);
}

model SetGroupMemberExtensionByKeysRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    appCid?: string(name='AppCid', example='$2$11222333'),
    appUid?: string(name='AppUid', example='11112'),
    extensions?: map[string]string(name='Extensions'),
  }(name='RequestParams'),
}

model SetGroupMemberExtensionByKeysShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model SetGroupMemberExtensionByKeysResponseBody = {
  code?: string(name='Code', example='General.SystemError'),
  message?: string(name='Message', example='System Error'),
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378F720'),
}

model SetGroupMemberExtensionByKeysResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetGroupMemberExtensionByKeysResponseBody(name='body'),
}

async function setGroupMemberExtensionByKeysWithOptions(tmpReq: SetGroupMemberExtensionByKeysRequest, runtime: Util.RuntimeOptions): SetGroupMemberExtensionByKeysResponse {
  Util.validateModel(tmpReq);
  var request = new SetGroupMemberExtensionByKeysShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SetGroupMemberExtensionByKeys',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setGroupMemberExtensionByKeys(request: SetGroupMemberExtensionByKeysRequest): SetGroupMemberExtensionByKeysResponse {
  var runtime = new Util.RuntimeOptions{};
  return setGroupMemberExtensionByKeysWithOptions(request, runtime);
}

model SetGroupOwnerRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    appCid?: string(name='AppCid', example='$2$11222333'),
    newOwnerAppUid?: string(name='NewOwnerAppUid', example='123123'),
  }(name='RequestParams'),
}

model SetGroupOwnerShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model SetGroupOwnerResponseBody = {
  code?: string(name='Code', example='General.SystemError'),
  message?: string(name='Message', example='System Error'),
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378F720'),
}

model SetGroupOwnerResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetGroupOwnerResponseBody(name='body'),
}

async function setGroupOwnerWithOptions(tmpReq: SetGroupOwnerRequest, runtime: Util.RuntimeOptions): SetGroupOwnerResponse {
  Util.validateModel(tmpReq);
  var request = new SetGroupOwnerShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SetGroupOwner',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setGroupOwner(request: SetGroupOwnerRequest): SetGroupOwnerResponse {
  var runtime = new Util.RuntimeOptions{};
  return setGroupOwnerWithOptions(request, runtime);
}

model SetMessageExtensionByKeysRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    appCid?: string(name='AppCid', example='$1$10010:10086'),
    extensions?: map[string]string(name='Extensions'),
    msgId?: string(name='MsgId', example='123123.center_daily'),
  }(name='RequestParams'),
}

model SetMessageExtensionByKeysShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model SetMessageExtensionByKeysResponseBody = {
  code?: string(name='Code', example='User.xxx'),
  message?: string(name='Message', example='System Error'),
  requestId?: string(name='RequestId', example='788DABCD-A3CF-48B2-9F80-E57B41A2169A'),
}

model SetMessageExtensionByKeysResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetMessageExtensionByKeysResponseBody(name='body'),
}

async function setMessageExtensionByKeysWithOptions(tmpReq: SetMessageExtensionByKeysRequest, runtime: Util.RuntimeOptions): SetMessageExtensionByKeysResponse {
  Util.validateModel(tmpReq);
  var request = new SetMessageExtensionByKeysShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SetMessageExtensionByKeys',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setMessageExtensionByKeys(request: SetMessageExtensionByKeysRequest): SetMessageExtensionByKeysResponse {
  var runtime = new Util.RuntimeOptions{};
  return setMessageExtensionByKeysWithOptions(request, runtime);
}

model SetMessageReadRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    appUid?: string(name='AppUid', example='95****010'),
    msgId?: string(name='MsgId', example='280****5705.center_daily'),
  }(name='RequestParams'),
}

model SetMessageReadShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model SetMessageReadResponseBody = {
  code?: string(name='Code', example='User.xxx'),
  message?: string(name='Message', example='System Error'),
  requestId?: string(name='RequestId', example='DB6426C9-B553-66A2-B5F4-0B912D39EABB'),
}

model SetMessageReadResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetMessageReadResponseBody(name='body'),
}

async function setMessageReadWithOptions(tmpReq: SetMessageReadRequest, runtime: Util.RuntimeOptions): SetMessageReadResponse {
  Util.validateModel(tmpReq);
  var request = new SetMessageReadShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SetMessageRead',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setMessageRead(request: SetMessageReadRequest): SetMessageReadResponse {
  var runtime = new Util.RuntimeOptions{};
  return setMessageReadWithOptions(request, runtime);
}

model SetSingleChatExtensionByKeysRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    appCid?: string(name='AppCid', example='$1$111000:123'),
    appUid?: string(name='AppUid', example='123456'),
    extensions?: map[string]string(name='Extensions'),
  }(name='RequestParams'),
}

model SetSingleChatExtensionByKeysShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model SetSingleChatExtensionByKeysResponseBody = {
  code?: string(name='Code', example='General.SystemError'),
  message?: string(name='Message', example='System Error'),
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378F720'),
}

model SetSingleChatExtensionByKeysResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetSingleChatExtensionByKeysResponseBody(name='body'),
}

async function setSingleChatExtensionByKeysWithOptions(tmpReq: SetSingleChatExtensionByKeysRequest, runtime: Util.RuntimeOptions): SetSingleChatExtensionByKeysResponse {
  Util.validateModel(tmpReq);
  var request = new SetSingleChatExtensionByKeysShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SetSingleChatExtensionByKeys',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setSingleChatExtensionByKeys(request: SetSingleChatExtensionByKeysRequest): SetSingleChatExtensionByKeysResponse {
  var runtime = new Util.RuntimeOptions{};
  return setSingleChatExtensionByKeysWithOptions(request, runtime);
}

model SetUserConversationExtensionByKeysRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    appCid?: string(name='AppCid', example='$2$111000'),
    appUid?: string(name='AppUid', example='123456'),
    extensions?: map[string]string(name='Extensions'),
  }(name='RequestParams'),
}

model SetUserConversationExtensionByKeysShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model SetUserConversationExtensionByKeysResponseBody = {
  code?: string(name='Code', example='General.SystemError'),
  message?: string(name='Message', example='System Error'),
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378F720'),
}

model SetUserConversationExtensionByKeysResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SetUserConversationExtensionByKeysResponseBody(name='body'),
}

async function setUserConversationExtensionByKeysWithOptions(tmpReq: SetUserConversationExtensionByKeysRequest, runtime: Util.RuntimeOptions): SetUserConversationExtensionByKeysResponse {
  Util.validateModel(tmpReq);
  var request = new SetUserConversationExtensionByKeysShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SetUserConversationExtensionByKeys',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function setUserConversationExtensionByKeys(request: SetUserConversationExtensionByKeysRequest): SetUserConversationExtensionByKeysResponse {
  var runtime = new Util.RuntimeOptions{};
  return setUserConversationExtensionByKeysWithOptions(request, runtime);
}

model SilenceAllGroupMembersRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    appCid?: string(name='AppCid', example='$2$10010'),
    operatorAppUid?: string(name='OperatorAppUid', example='123123'),
  }(name='RequestParams'),
}

model SilenceAllGroupMembersShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model SilenceAllGroupMembersResponseBody = {
  code?: string(name='Code', example='General.SystemError'),
  message?: string(name='Message', example='System Error'),
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378F720'),
}

model SilenceAllGroupMembersResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: SilenceAllGroupMembersResponseBody(name='body'),
}

async function silenceAllGroupMembersWithOptions(tmpReq: SilenceAllGroupMembersRequest, runtime: Util.RuntimeOptions): SilenceAllGroupMembersResponse {
  Util.validateModel(tmpReq);
  var request = new SilenceAllGroupMembersShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'SilenceAllGroupMembers',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function silenceAllGroupMembers(request: SilenceAllGroupMembersRequest): SilenceAllGroupMembersResponse {
  var runtime = new Util.RuntimeOptions{};
  return silenceAllGroupMembersWithOptions(request, runtime);
}

model UnbindInterconnectionUidRequest {
  appId?: string(name='AppId', description='AppId', example='apitest'),
  requestParams?: {
    appUid?: string(name='AppUid', example='12345'),
    dingTalkUid?: string(name='DingTalkUid', example='staff#coprId'),
  }(name='RequestParams'),
}

model UnbindInterconnectionUidShrinkRequest {
  appId?: string(name='AppId', description='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model UnbindInterconnectionUidResponseBody = {
  code?: string(name='Code', example='408'),
  message?: string(name='Message'),
  requestId?: string(name='RequestId', example='12224444'),
}

model UnbindInterconnectionUidResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UnbindInterconnectionUidResponseBody(name='body'),
}

/**
  * @deprecated
  *
  * @param tmpReq UnbindInterconnectionUidRequest
  * @param runtime runtime options for this request RuntimeOptions
  * @return UnbindInterconnectionUidResponse
 */
// Deprecated
async function unbindInterconnectionUidWithOptions(tmpReq: UnbindInterconnectionUidRequest, runtime: Util.RuntimeOptions): UnbindInterconnectionUidResponse {
  Util.validateModel(tmpReq);
  var request = new UnbindInterconnectionUidShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UnbindInterconnectionUid',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
  * @deprecated
  *
  * @param request UnbindInterconnectionUidRequest
  * @return UnbindInterconnectionUidResponse
 */
// Deprecated
async function unbindInterconnectionUid(request: UnbindInterconnectionUidRequest): UnbindInterconnectionUidResponse {
  var runtime = new Util.RuntimeOptions{};
  return unbindInterconnectionUidWithOptions(request, runtime);
}

model UpdateAppNameRequest {
  appId?: string(name='AppId', example='aaa111'),
  requestParams?: {
    appName?: string(name='AppName', example='xiaohongshu'),
  }(name='RequestParams'),
}

model UpdateAppNameShrinkRequest {
  appId?: string(name='AppId', example='aaa111'),
  requestParamsShrink?: string(name='RequestParams'),
}

model UpdateAppNameResponseBody = {
  code?: string(name='Code', description='code', example='503'),
  httpStatusCode?: int32(name='HttpStatusCode', description='httpStatusCode', example='200'),
  message?: string(name='Message', description='desc', example='fail'),
  requestId?: string(name='RequestId', description='requestId', example='123456'),
  success?: boolean(name='Success', description='success', example='false'),
}

model UpdateAppNameResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateAppNameResponseBody(name='body'),
}

async function updateAppNameWithOptions(tmpReq: UpdateAppNameRequest, runtime: Util.RuntimeOptions): UpdateAppNameResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateAppNameShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateAppName',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateAppName(request: UpdateAppNameRequest): UpdateAppNameResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAppNameWithOptions(request, runtime);
}

model UpdateAppStatusRequest {
  appId?: string(name='AppId', example='aaa111'),
  requestParams?: {
    enable?: boolean(name='Enable', example='true'),
  }(name='RequestParams'),
}

model UpdateAppStatusShrinkRequest {
  appId?: string(name='AppId', example='aaa111'),
  requestParamsShrink?: string(name='RequestParams'),
}

model UpdateAppStatusResponseBody = {
  code?: string(name='Code', example='50001'),
  message?: string(name='Message', example='param error'),
  requestId?: string(name='RequestId', description='Id of the request', example='11114444'),
  success?: boolean(name='Success', example='true'),
}

model UpdateAppStatusResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateAppStatusResponseBody(name='body'),
}

async function updateAppStatusWithOptions(tmpReq: UpdateAppStatusRequest, runtime: Util.RuntimeOptions): UpdateAppStatusResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateAppStatusShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateAppStatus',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateAppStatus(request: UpdateAppStatusRequest): UpdateAppStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateAppStatusWithOptions(request, runtime);
}

model UpdateCallbackConfigRequest {
  appId?: string(name='AppId', example='aaa111'),
  requestParams?: {
    apis?: map[string]boolean(name='Apis'),
    callbackUrl?: string(name='CallbackUrl', example='http://test.com'),
    events?: map[string]boolean(name='Events'),
    signatureKey?: string(name='SignatureKey', example='aaa111_0'),
    signatureValue?: string(name='SignatureValue', example='aaa111232434sefdf'),
    spis?: map[string]boolean(name='Spis'),
  }(name='RequestParams'),
}

model UpdateCallbackConfigShrinkRequest {
  appId?: string(name='AppId', example='aaa111'),
  requestParamsShrink?: string(name='RequestParams'),
}

model UpdateCallbackConfigResponseBody = {
  code?: string(name='Code', description='code', example='systemError'),
  httpStatusCode?: int32(name='HttpStatusCode', description='httpStatusCode', example='400'),
  message?: string(name='Message', description='desc', example='错误信息'),
  requestId?: string(name='RequestId', description='requestId', example='13456'),
  result?: {
    imConfig?: {
      callbackConfig?: {
        apiIds?: [ string ](name='ApiIds'),
        backendUrl?: string(name='BackendUrl', example='http://test.com'),
        signatureKey?: string(name='SignatureKey', example='aaa111_0'),
        signatureValue?: string(name='SignatureValue', example='3324ewfcsf34r'),
      }(name='CallbackConfig'),
      msgConfig?: {
        msgRecallTimeInterval?: long(name='MsgRecallTimeInterval', example='12000'),
      }(name='MsgConfig'),
    }(name='ImConfig'),
  }(name='Result', description='result'),
  success?: boolean(name='Success', description='success', example='false'),
}

model UpdateCallbackConfigResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateCallbackConfigResponseBody(name='body'),
}

/**
  * @deprecated
  *
  * @param tmpReq UpdateCallbackConfigRequest
  * @param runtime runtime options for this request RuntimeOptions
  * @return UpdateCallbackConfigResponse
 */
// Deprecated
async function updateCallbackConfigWithOptions(tmpReq: UpdateCallbackConfigRequest, runtime: Util.RuntimeOptions): UpdateCallbackConfigResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateCallbackConfigShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateCallbackConfig',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

/**
  * @deprecated
  *
  * @param request UpdateCallbackConfigRequest
  * @return UpdateCallbackConfigResponse
 */
// Deprecated
async function updateCallbackConfig(request: UpdateCallbackConfigRequest): UpdateCallbackConfigResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateCallbackConfigWithOptions(request, runtime);
}

model UpdateGroupIconRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    appCid?: string(name='AppCid', example='$2$111000'),
    iconMediaId?: string(name='IconMediaId', example='$iQEMAqNqcGcDAQTNAyAFzQJYBtoAIYQBpAuf1dQCqrY4aIGemoBLONIDzwAAAXazCVSoBM0NyAcACA****'),
    operatorAppUid?: string(name='OperatorAppUid', example='80000010'),
  }(name='RequestParams'),
}

model UpdateGroupIconShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model UpdateGroupIconResponseBody = {
  code?: string(name='Code', example='General.SystemError'),
  message?: string(name='Message', example='System Error'),
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378F720'),
}

model UpdateGroupIconResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateGroupIconResponseBody(name='body'),
}

async function updateGroupIconWithOptions(tmpReq: UpdateGroupIconRequest, runtime: Util.RuntimeOptions): UpdateGroupIconResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateGroupIconShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateGroupIcon',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateGroupIcon(request: UpdateGroupIconRequest): UpdateGroupIconResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateGroupIconWithOptions(request, runtime);
}

model UpdateGroupMembersRoleRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    appCid?: string(name='AppCid', example='11222333'),
    appUids?: [ string ](name='AppUids', example='value1'),
    operatorAppUid?: string(name='OperatorAppUid', example='123123'),
    role?: int32(name='Role', example='3'),
  }(name='RequestParams', example='apitest'),
}

model UpdateGroupMembersRoleShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams', example='apitest'),
}

model UpdateGroupMembersRoleResponseBody = {
  code?: string(name='Code', example='General.SystemError'),
  message?: string(name='Message', example='System Error'),
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378F720'),
}

model UpdateGroupMembersRoleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateGroupMembersRoleResponseBody(name='body'),
}

async function updateGroupMembersRoleWithOptions(tmpReq: UpdateGroupMembersRoleRequest, runtime: Util.RuntimeOptions): UpdateGroupMembersRoleResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateGroupMembersRoleShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateGroupMembersRole',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateGroupMembersRole(request: UpdateGroupMembersRoleRequest): UpdateGroupMembersRoleResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateGroupMembersRoleWithOptions(request, runtime);
}

model UpdateGroupTitleRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParams?: {
    appCid?: string(name='AppCid', example='$2$111000'),
    operatorAppUid?: string(name='OperatorAppUid', example='80000010'),
    title?: string(name='Title', example='新群聊标题'),
  }(name='RequestParams'),
}

model UpdateGroupTitleShrinkRequest {
  appId?: string(name='AppId', example='apitest'),
  requestParamsShrink?: string(name='RequestParams'),
}

model UpdateGroupTitleResponseBody = {
  code?: string(name='Code', example='User.xxx'),
  message?: string(name='Message', example='System Error'),
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378F720'),
}

model UpdateGroupTitleResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateGroupTitleResponseBody(name='body'),
}

async function updateGroupTitleWithOptions(tmpReq: UpdateGroupTitleRequest, runtime: Util.RuntimeOptions): UpdateGroupTitleResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateGroupTitleShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateGroupTitle',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateGroupTitle(request: UpdateGroupTitleRequest): UpdateGroupTitleResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateGroupTitleWithOptions(request, runtime);
}

model UpdateMsgRecallIntervalRequest {
  appId?: string(name='AppId', example='aaa111'),
  requestParams?: {
    clientMsgRecallIntervalMinute?: long(name='ClientMsgRecallIntervalMinute', example='12000'),
  }(name='RequestParams'),
}

model UpdateMsgRecallIntervalShrinkRequest {
  appId?: string(name='AppId', example='aaa111'),
  requestParamsShrink?: string(name='RequestParams'),
}

model UpdateMsgRecallIntervalResponseBody = {
  code?: string(name='Code', description='code', example='Success'),
  httpStatusCode?: int32(name='HttpStatusCode', description='httpStatusCode', example='200'),
  message?: string(name='Message', description='desc', example='error'),
  requestId?: string(name='RequestId', description='requestId', example='122-EFSDFSDFE-123'),
  result?: string(name='Result', description='result', example='null'),
  success?: boolean(name='Success', description='success', example='true'),
}

model UpdateMsgRecallIntervalResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateMsgRecallIntervalResponseBody(name='body'),
}

async function updateMsgRecallIntervalWithOptions(tmpReq: UpdateMsgRecallIntervalRequest, runtime: Util.RuntimeOptions): UpdateMsgRecallIntervalResponse {
  Util.validateModel(tmpReq);
  var request = new UpdateMsgRecallIntervalShrinkRequest{};
  OpenApiUtil.convert(tmpReq, request);
  if (!Util.isUnset(tmpReq.requestParams)) {
    request.requestParamsShrink = OpenApiUtil.arrayToStringWithSpecifiedStyle(tmpReq.requestParams, 'RequestParams', 'json');
  }
  var body : map[string]any = {};
  if (!Util.isUnset(request.appId)) {
    body['AppId'] = request.appId;
  }
  if (!Util.isUnset(request.requestParamsShrink)) {
    body['RequestParams'] = request.requestParamsShrink;
  }
  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateMsgRecallInterval',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateMsgRecallInterval(request: UpdateMsgRecallIntervalRequest): UpdateMsgRecallIntervalResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateMsgRecallIntervalWithOptions(request, runtime);
}

model UpdateTenantStatusRequest {
  request?: {
    domain?: string(name='domain', example='testAppKey'),
    status?: long(name='status', example='0'),
  }(name='Request'),
}

model UpdateTenantStatusResponseBody = {
  requestId?: string(name='RequestId', example='C02635EE-C867-4CC0-9DE0-E4497378****'),
  responseSuccess?: boolean(name='ResponseSuccess', example='true'),
  errorCode?: string(name='errorCode', example='1001'),
  errorMsg?: string(name='errorMsg', example='参数错误'),
  result?: boolean(name='result', example='true'),
}

model UpdateTenantStatusResponse = {
  headers: map[string]string(name='headers'),
  statusCode: int32(name='statusCode'),
  body: UpdateTenantStatusResponseBody(name='body'),
}

async function updateTenantStatusWithOptions(request: UpdateTenantStatusRequest, runtime: Util.RuntimeOptions): UpdateTenantStatusResponse {
  Util.validateModel(request);
  var body : map[string]any = {};
  var bodyFlat : map[string]any = {};
  if (!Util.isUnset(request.request)) {
    bodyFlat['Request'] = request.request;
  }
  body = {
    ...body,
    ...OpenApiUtil.query(bodyFlat),
  };

  var req = new OpenApi.OpenApiRequest{ 
    body = OpenApiUtil.parseToMap(body),
  };
  var params = new OpenApi.Params{
    action = 'UpdateTenantStatus',
    version = '2020-12-14',
    protocol = 'HTTPS',
    pathname = '/',
    method = 'POST',
    authType = 'AK',
    style = 'RPC',
    reqBodyType = 'formData',
    bodyType = 'json',
  };
  return callApi(params, req, runtime);
}

async function updateTenantStatus(request: UpdateTenantStatusRequest): UpdateTenantStatusResponse {
  var runtime = new Util.RuntimeOptions{};
  return updateTenantStatusWithOptions(request, runtime);
}

